package com.dynamixsoftware.printershare.data;

import java.io.ByteArrayInputStream;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class SoapEnvelope
{
  static final String namespace = "http://www.printeranywhere.com/";
  static final String template = "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body></soap:Body></soap:Envelope>";
  String action_name;
  String action_root;
  Element data;
  String data_root;
  Document doc;
  
  public SoapEnvelope(String paramString1, String paramString2, String paramString3)
    throws Exception
  {
    this.action_name = paramString1;
    this.action_root = paramString2;
    this.data_root = paramString3;
    this.doc = XmlUtil.getDocument(new ByteArrayInputStream("<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body></soap:Body></soap:Envelope>".getBytes()));
    Element localElement1 = XmlUtil.appendElement((Element)this.doc.getDocumentElement().getFirstChild(), paramString1);
    localElement1.setAttribute("xmlns", "http://www.printeranywhere.com/");
    Element localElement2 = XmlUtil.appendElement(localElement1, paramString2);
    if (paramString3 != null)
    {
      this.data = XmlUtil.appendElement(localElement2, paramString3);
      this.data.setAttribute("xmlns", "");
      return;
    }
    this.data = localElement2;
  }
  
  SoapEnvelope(String paramString1, String paramString2, String paramString3, Document paramDocument)
    throws Exception
  {
    this.action_name = paramString1;
    this.action_root = paramString2;
    this.data_root = paramString3;
    this.doc = paramDocument;
    this.data = ((Element)XmlUtil.getFirstNode(((Element)paramDocument.getDocumentElement().getFirstChild()).getFirstChild(), paramString2));
    if (paramString3 != null) {
      this.data = ((Element)XmlUtil.getFirstNode(this.data, paramString3));
    }
  }
  
  public Element getDataRoot()
  {
    return this.data;
  }
}


/* Location:           C:\Users\Admin\Desktop\Decompiler\JAD\jd-gui-0.3.6.windows\classes_dex2jar.jar
 * Qualified Name:     com.dynamixsoftware.printershare.data.SoapEnvelope
 * JD-Core Version:    0.7.0.1
 */